package com.xbongbong.paas.abstracts;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.help.factory.OperatorFieldHandler;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.businessrule.pojo.BusinessRuleInfoPojo;

/**
 * @author 吴峰
 * @date 2022/03/09 14:53
 */
public abstract class AbstractOperatorFieldHandler implements OperatorFieldHandler {

    @Override
    public Object handlerThisFormField(PaasFormDataEntity paasFormDataEntity, JSONObject data, FieldAttrEntity fieldAttrEntity, BusinessRuleInfoPojo businessRuleInfoPojo) throws XbbException {
        // 默认工厂
        return data.get(fieldAttrEntity.getAttr());
    }
}
